#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
using namespace std;

int main()
{
    string s1;
    cin >> s1;
    auto arr = new int[256]();
    for (int i = 0; i < s1.size(); i++)
    {
        arr[s1[i] - '0']++;
    }
    for (int i = 0; i < s1.size(); ++i)
    {
        int num = s1[i] - '0';
        if (arr[s1[i] - '0'] == 1)
        {
            char TheOnefirst = num + '0';
            delete[] arr;
            cout << TheOnefirst << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}


